
    var layer,
        element ;
    layui.use(['layer','element','form','jquery'], function(){

        let  layerIndex,
            $ = layui.$, //重点处
            form=layui.form;
        layer = layui.layer;
        element = layui.element;
        $(".title").fadeIn(2000);
        $(".start-chat").fadeIn(2000);
        $(".start-chat").click(function () {
            layerIndex=layer.open({
                type: 1,
                title:"基本信息",
                content: $(".layui-form"), //这里content是一个普通的String
                area:"90%"
            });
        });
        $("#cancle-submit").click(function () {
            layer.close(layerIndex)
        });
        // 立即聊天
        form.on('submit(form)', function(data){
            data.field.uid=uid;
            data.field.mode=Number(data.field.mode);
            data.field.sex=Number(data.field.sex);
            data.field.scene=2;
            sendScene(conn,data.field);
            layer.close(layerIndex);
            // 触发 loading 动画
            $("#loading").show();
            $(".start-chat").hide();
        });
    });

